using AnyCAD.Forms;
using AnyCAD.Foundation;
using System.Windows.Forms;

namespace WinFormsTabs
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        List<RenderControl> _RenderViews = new List<RenderControl>();
        int ii = 0;
        private void 新建ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ++ii;
            var tabPage = new TabPage("View-" + ii.ToString());
            tabControl1.TabPages.Add(tabPage);
            var renderControl = new RenderControl(tabPage);
            renderControl.ViewerReady += RenderControl_ViewerReady;
            _RenderViews.Add(renderControl);          
            tabControl1.SelectTab(ii - 1);
        }

        private void RenderControl_ViewerReady()
        {
            // 视图初始化好了
        }
    }
}
